/*
using MyGeneration/Template/NHibernate (c) by Sharp 1.4
based on OHM (alvy77@hotmail.com)
*/
using System;
using System.Collections;
using System.Collections.Generic;

namespace DomainModel
{

	/// <summary>
	/// ILibraryBookDetail interface for NHibernate mapped table 'LibraryBookDetail'.
	/// </summary>
	public interface ILibraryBookDetail
	{
		#region Public Properties
		
		int lbd_id
		{
			get ;
			set ;
			  
		}
		
		int? lbd_lbid
		{
			get ;
			set ;
			  
		}
		
		string lbd_isbn
		{
			get ;
			set ;
			  
		}
		
		byte lbd_state
		{
			get ;
			set ;
			  
		}
		
		int lbd_user
		{
			get ;
			set ;
			  
		}
		
		DateTime lbd_addTime
		{
			get ;
			set ;
			  
		}
		
		int? lbd_lastUser
		{
			get ;
			set ;
			  
		}
		
		DateTime? lbd_updateTime
		{
			get ;
			set ;
			  
		}
		
		bool IsDeleted { get; set; }
		bool IsChanged { get; set; }
		
		#endregion 
	}

	/// <summary>
	/// LibraryBookDetail object for NHibernate mapped table 'LibraryBookDetail'.
	/// </summary>
	[Serializable]
	public class LibraryBookDetail : ICloneable,ILibraryBookDetail
	{
		#region Member Variables

		protected int _lbd_id;
		protected int? _lbd_lbid;
		protected string _lbd_isbn;
		protected byte _lbd_state;
		protected int _lbd_user;
		protected DateTime _lbd_addtime;
		protected int? _lbd_lastuser;
		protected DateTime? _lbd_updatetime;
		protected bool _bIsDeleted;
		protected bool _bIsChanged;
		#endregion
		
		#region Constructors
		public LibraryBookDetail() {}
		
		public LibraryBookDetail(int? plbdlbid, string plbdisbn, byte plbdstate, int plbduser, DateTime plbdaddTime, int? plbdlastUser, DateTime? plbdupdateTime)
		{
			this._lbd_lbid = plbdlbid; 
			this._lbd_isbn = plbdisbn; 
			this._lbd_state = plbdstate; 
			this._lbd_user = plbduser; 
			this._lbd_addtime = plbdaddTime; 
			this._lbd_lastuser = plbdlastUser; 
			this._lbd_updatetime = plbdupdateTime; 
		}
		
		public LibraryBookDetail(string plbdisbn, byte plbdstate, int plbduser, DateTime plbdaddTime)
		{
			this._lbd_isbn = plbdisbn; 
			this._lbd_state = plbdstate; 
			this._lbd_user = plbduser; 
			this._lbd_addtime = plbdaddTime; 
		}
		
		public LibraryBookDetail(int plbdid)
		{
			this._lbd_id = plbdid; 
		}
		
		#endregion
		
		#region Public Properties
		
		public virtual int lbd_id
		{
			get { return _lbd_id; }
			set { _bIsChanged |= (_lbd_id != value); _lbd_id = value; }
			
		}
		
		public virtual int? lbd_lbid
		{
			get { return _lbd_lbid; }
			set { _bIsChanged |= (_lbd_lbid != value); _lbd_lbid = value; }
			
		}
		
		public virtual string lbd_isbn
		{
			get { return _lbd_isbn; }
			set 
			{
			  if (value != null && value.Length > 50)
			    throw new ArgumentOutOfRangeException("lbd_isbn", "lbd_isbn value, cannot contain more than 50 characters");
			  _bIsChanged |= (_lbd_isbn != value); 
			  _lbd_isbn = value; 
			}
			
		}
		
		public virtual byte lbd_state
		{
			get { return _lbd_state; }
			set { _bIsChanged |= (_lbd_state != value); _lbd_state = value; }
			
		}
		
		public virtual int lbd_user
		{
			get { return _lbd_user; }
			set { _bIsChanged |= (_lbd_user != value); _lbd_user = value; }
			
		}
		
		public virtual DateTime lbd_addTime
		{
			get { return _lbd_addtime; }
			set { _bIsChanged |= (_lbd_addtime != value); _lbd_addtime = value; }
			
		}
		
		public virtual int? lbd_lastUser
		{
			get { return _lbd_lastuser; }
			set { _bIsChanged |= (_lbd_lastuser != value); _lbd_lastuser = value; }
			
		}
		
		public virtual DateTime? lbd_updateTime
		{
			get { return _lbd_updatetime; }
			set { _bIsChanged |= (_lbd_updatetime != value); _lbd_updatetime = value; }
			
		}
		

		public virtual bool IsDeleted
		{
			get
			{
				return _bIsDeleted;
			}
			set
			{
				_bIsDeleted = value;
			}
		}
		
		public virtual bool IsChanged
		{
			get
			{
				return _bIsChanged;
			}
			set
			{
				_bIsChanged = value;
			}
		}
		
		#endregion 
		
		#region Equals And HashCode Overrides
		/// <summary>
		/// local implementation of Equals based on unique value members
		/// </summary>
		public override bool Equals( object obj )
		{
			if( this == obj ) return true;
			LibraryBookDetail castObj = null;
			try
			{
				castObj = (LibraryBookDetail)obj;
			} catch(Exception) { return false; } 
			return ( castObj != null ) &&
				( this._lbd_id == castObj.lbd_id );
		}
		/// <summary>
		/// local implementation of GetHashCode based on unique value members
		/// </summary>
		public override int GetHashCode()
		{
		  
			
			int hash = 57; 
			hash = 27 * hash * _lbd_id.GetHashCode();
			return hash; 
		}
		#endregion
		
		#region ICloneable methods
		
		public virtual object Clone()
		{
			return this.MemberwiseClone();
		}
		
		#endregion
	}
	
	#region Custom ICollection interface for LibraryBookDetail 

	
	public interface ILibraryBookDetailCollection : ICollection
	{
		LibraryBookDetail this[int index]{	get; set; }
		void Add(LibraryBookDetail pLibraryBookDetail);
		void Clear();
	}
	
	[Serializable]
	public class LibraryBookDetailCollection : ILibraryBookDetailCollection
	{
		private IList<LibraryBookDetail> _arrayInternal;

		public LibraryBookDetailCollection()
		{
			_arrayInternal = new List<LibraryBookDetail>();
		}
		
		public LibraryBookDetailCollection( IList<LibraryBookDetail> pSource )
		{
			_arrayInternal = pSource;
			if(_arrayInternal == null)
			{
				_arrayInternal = new List<LibraryBookDetail>();
			}
		}

		public LibraryBookDetail this[int index]
		{
			get
			{
				return _arrayInternal[index];
			}
			set
			{
				_arrayInternal[index] = value;
			}
		}

		public int Count { get { return _arrayInternal.Count; } }
		public bool IsSynchronized { get { return false; } }
		public object SyncRoot { get { return _arrayInternal; } }
		public void CopyTo(Array array, int index){ _arrayInternal.CopyTo((LibraryBookDetail[])array, index); }
		public IEnumerator GetEnumerator() { return _arrayInternal.GetEnumerator(); }
		public void Add(LibraryBookDetail pLibraryBookDetail) { _arrayInternal.Add(pLibraryBookDetail); }
		public void Clear() { _arrayInternal.Clear(); }
		public IList<LibraryBookDetail> GetList() { return _arrayInternal; }
	 }
	
	#endregion
}
